﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DotNetNuke.Entities.Modules;
using FortyFingers.Windows8Pin.Components;

namespace FortyFingers.Windows8Pin
{
    public partial class Settings : ModuleSettingsBase
    {
        protected DotNetNuke.UI.UserControls.UrlControl TileImageFile;

        private Config _config = null;

        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public override void LoadSettings()
        {
            _config = new Config(Settings, ModuleId, TabModuleId);

            txtTileTitle.Text = _config.TileTitle;
            txtTileBackground.Text = _config.TileBackground;

            if (!String.IsNullOrEmpty(_config.TileImageUrl))
                TileImageFile.Url = _config.TileImageUrl;
        }
        public override void UpdateSettings()
        {
            _config = new Config(Settings, ModuleId, TabModuleId);

            _config.TileTitle = txtTileTitle.Text;
            _config.TileBackground = txtTileBackground.Text;
            _config.TileImageUrl = TileImageFile.Url;
        }
    }
}